dojo.declare("MVendorProductCatalogsPg", wm.Page, {
    start: function() {
        var mainPage = wm.Page.getPage("MobileMainPg");

        this.lvMenuItems.filter.setValue("customer.customerId", mainPage.vUserId);

        this.lvMenuItems.update();

    },
    "preferredDevice": "phone",

    itemsDojoGridImageUrlFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        try {
            var file = "services/FileUploadDownload.download?method=downloadFile&fileName=" + inValue;
            return '<img  style="height: 50px;" src="' + file + '" />';
        } catch (e) {
            console.error('ERROR IN dojoGrid2PicurlFormat: ' + e);
        }
    },
    itemsDojoGridItemIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        var currency="";
        if(rowObj.currency && rowObj.currency !==null){
            currency=rowObj.currency;
            }
        var display = "<div class='MobileRowTitle'>ItemName: " + rowObj.itemName +
        "</div>" + "<div class='MobileRow'>ItemDesc: " + rowObj.itemDesc +
        "</div>" + "<div class='MobileRow'>Also called: " + rowObj.otherNames +
        "</div>" + "<div class='MobileRow'>Price: " + rowObj.price +" "+currency + "</div>";
        var outOfStock = "No";
        if (rowObj.outOfStock) {
            outOfStock = "Yes";
        }


        display = display + "<div class='MobileRow'>OutOfStock: " + outOfStock + "</div>";
        // display = display + "<div class='MobileRow'>Is Active: " + rowObj.active + "</div>";
        return display;
    },
    _end: 0
});